Skip to content

NETOBSERV-2078: Fix Openshift version check to work on ROSA#1052

Closed
msherif1234 wants to merge 1 commit intonetobserv:mainfrom
msherif1234:fix_ocp_chk
Closed

NETOBSERV-2078: Fix Openshift version check to work on ROSA#1052
msherif1234 wants to merge 1 commit intonetobserv:mainfrom
msherif1234:fix_ocp_chk

Conversation

@msherif1234
Copy link
Contributor

Description

Fix OCP version check to work on ROSA

Dependencies

n/a

Checklist

If you are not familiar with our processes or don't know what to answer in the list below, let us know in a comment: the maintainers will take care of that.

  • Is this PR backed with a JIRA ticket? If so, make sure it is written as a title prefix (in general, PRs affecting the NetObserv/Network Observability product should be backed with a JIRA ticket - especially if they bring user facing changes).
  • Does this PR require product documentation?
    • If so, make sure the JIRA epic is labeled with "documentation" and provides a description relevant for doc writers, such as use cases or scenarios. Any required step to activate or configure the feature should be documented there, such as new CRD knobs.
  • Does this PR require a product release notes entry?
    • If so, fill in "Release Note Text" in the JIRA.
  • Is there anything else the QE team should know before testing? E.g: configuration changes, environment setup, etc.
    • If so, make sure it is described in the JIRA ticket.
  • QE requirements (check 1 from the list):
    • Standard QE validation, with pre-merge tests unless stated otherwise.
    • Regression tests only (e.g. refactoring with no user-facing change).
    • No QE (e.g. trivial change with high reviewer's confidence, or per agreement with the QE team).

@openshift-ci
Copy link

openshift-ci bot commented Jan 24, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from msherif1234. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@msherif1234 msherif1234 requested a review from jotak January 24, 2025 13:00
@msherif1234
Copy link
Contributor Author

/ok-to-test

@openshift-ci openshift-ci bot added the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Jan 24, 2025
@github-actions github-actions bot removed the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Jan 24, 2025
@msherif1234
Copy link
Contributor Author

/ok-to-test

@openshift-ci openshift-ci bot added the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Jan 24, 2025
@github-actions
Copy link

New images:

  • quay.io/netobserv/network-observability-operator:4e8a7e9
  • quay.io/netobserv/network-observability-operator-bundle:v0.0.0-4e8a7e9
  • quay.io/netobserv/network-observability-operator-catalog:v0.0.0-4e8a7e9

They will expire after two weeks.

To deploy this build:

# Direct deployment, from operator repo
IMAGE=quay.io/netobserv/network-observability-operator:4e8a7e9 make deploy

# Or using operator-sdk
operator-sdk run bundle quay.io/netobserv/network-observability-operator-bundle:v0.0.0-4e8a7e9

Or as a Catalog Source:

apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: netobserv-dev
  namespace: openshift-marketplace
spec:
  sourceType: grpc
  image: quay.io/netobserv/network-observability-operator-catalog:v0.0.0-4e8a7e9
  displayName: NetObserv development catalog
  publisher: Me
  updateStrategy:
    registryPoll:
      interval: 1m

@github-actions
Copy link

New images:

  • quay.io/netobserv/network-observability-operator:b60e62e
  • quay.io/netobserv/network-observability-operator-bundle:v0.0.0-b60e62e
  • quay.io/netobserv/network-observability-operator-catalog:v0.0.0-b60e62e

They will expire after two weeks.

To deploy this build:

# Direct deployment, from operator repo
IMAGE=quay.io/netobserv/network-observability-operator:b60e62e make deploy

# Or using operator-sdk
operator-sdk run bundle quay.io/netobserv/network-observability-operator-bundle:v0.0.0-b60e62e

Or as a Catalog Source:

apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: netobserv-dev
  namespace: openshift-marketplace
spec:
  sourceType: grpc
  image: quay.io/netobserv/network-observability-operator-catalog:v0.0.0-b60e62e
  displayName: NetObserv development catalog
  publisher: Me
  updateStrategy:
    registryPoll:
      interval: 1m

@github-actions github-actions bot removed the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Jan 24, 2025
@msherif1234
Copy link
Contributor Author

/ok-to-test

@openshift-ci openshift-ci bot added the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Jan 24, 2025
@github-actions
Copy link

New images:

  • quay.io/netobserv/network-observability-operator:8cbb421
  • quay.io/netobserv/network-observability-operator-bundle:v0.0.0-8cbb421
  • quay.io/netobserv/network-observability-operator-catalog:v0.0.0-8cbb421

They will expire after two weeks.

To deploy this build:

# Direct deployment, from operator repo
IMAGE=quay.io/netobserv/network-observability-operator:8cbb421 make deploy

# Or using operator-sdk
operator-sdk run bundle quay.io/netobserv/network-observability-operator-bundle:v0.0.0-8cbb421

Or as a Catalog Source:

apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: netobserv-dev
  namespace: openshift-marketplace
spec:
  sourceType: grpc
  image: quay.io/netobserv/network-observability-operator-catalog:v0.0.0-8cbb421
  displayName: NetObserv development catalog
  publisher: Me
  updateStrategy:
    registryPoll:
      interval: 1m

@msherif1234
Copy link
Contributor Author

msherif1234 commented Jan 24, 2025

oc get clusteroperator network -o yaml | grep versions -A5
  versions:
  - name: operator
    version: 4.17.9

and the check works now on ROSA

oc create -f config/samples/flows_v1beta2_flowcollector.yaml 
Warning: The NetworkEvents/UDNMapping/EbpfManager features require OpenShift 4.18 or above (version detected: 4.17.9)
flowcollector.flows.netobserv.io/cluster created

@github-actions github-actions bot removed the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Jan 24, 2025
@msherif1234
Copy link
Contributor Author

/ok-to-test

@openshift-ci openshift-ci bot added the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Jan 24, 2025
@github-actions
Copy link

New images:

  • quay.io/netobserv/network-observability-operator:6d946f2
  • quay.io/netobserv/network-observability-operator-bundle:v0.0.0-6d946f2
  • quay.io/netobserv/network-observability-operator-catalog:v0.0.0-6d946f2

They will expire after two weeks.

To deploy this build:

# Direct deployment, from operator repo
IMAGE=quay.io/netobserv/network-observability-operator:6d946f2 make deploy

# Or using operator-sdk
operator-sdk run bundle quay.io/netobserv/network-observability-operator-bundle:v0.0.0-6d946f2

Or as a Catalog Source:

apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: netobserv-dev
  namespace: openshift-marketplace
spec:
  sourceType: grpc
  image: quay.io/netobserv/network-observability-operator-catalog:v0.0.0-6d946f2
  displayName: NetObserv development catalog
  publisher: Me
  updateStrategy:
    registryPoll:
      interval: 1m

@github-actions github-actions bot removed the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Jan 24, 2025
@msherif1234 msherif1234 force-pushed the fix_ocp_chk branch 2 times, most recently from f18bfd4 to a148271 Compare January 24, 2025 15:57
@msherif1234
Copy link
Contributor Author

/ok-to-test

@openshift-ci openshift-ci bot added the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Jan 24, 2025
@github-actions
Copy link

New images:

  • quay.io/netobserv/network-observability-operator:9cd0980
  • quay.io/netobserv/network-observability-operator-bundle:v0.0.0-9cd0980
  • quay.io/netobserv/network-observability-operator-catalog:v0.0.0-9cd0980

They will expire after two weeks.

To deploy this build:

# Direct deployment, from operator repo
IMAGE=quay.io/netobserv/network-observability-operator:9cd0980 make deploy

# Or using operator-sdk
operator-sdk run bundle quay.io/netobserv/network-observability-operator-bundle:v0.0.0-9cd0980

Or as a Catalog Source:

apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: netobserv-dev
  namespace: openshift-marketplace
spec:
  sourceType: grpc
  image: quay.io/netobserv/network-observability-operator-catalog:v0.0.0-9cd0980
  displayName: NetObserv development catalog
  publisher: Me
  updateStrategy:
    registryPoll:
      interval: 1m

if err != nil {
return fmt.Errorf("error fetching OpenShift Cluster Network Operator: %w", err)
}
c.ID = string(cversion.Spec.ClusterID)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need either another way to get the c.ID, or keep on reading ClusterVersion as well. It's a way to automatically populate the cluster name or id, when multiCluster is enabled. If there's something else that can uniquely identify the cluster, it can be considered for a replacement.
The cluster ID can be overridden so it's not too bad if it doesn't work just with rosa, users will have workarounds

@msherif1234 msherif1234 requested a review from jotak January 24, 2025 16:24
@github-actions github-actions bot removed the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Jan 24, 2025
@msherif1234
Copy link
Contributor Author

/ok-to-test

@openshift-ci openshift-ci bot added the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Jan 24, 2025
@msherif1234
Copy link
Contributor Author

/retest

@github-actions
Copy link

New images:

  • quay.io/netobserv/network-observability-operator:11ae6e1
  • quay.io/netobserv/network-observability-operator-bundle:v0.0.0-11ae6e1
  • quay.io/netobserv/network-observability-operator-catalog:v0.0.0-11ae6e1

They will expire after two weeks.

To deploy this build:

# Direct deployment, from operator repo
IMAGE=quay.io/netobserv/network-observability-operator:11ae6e1 make deploy

# Or using operator-sdk
operator-sdk run bundle quay.io/netobserv/network-observability-operator-bundle:v0.0.0-11ae6e1

Or as a Catalog Source:

apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: netobserv-dev
  namespace: openshift-marketplace
spec:
  sourceType: grpc
  image: quay.io/netobserv/network-observability-operator-catalog:v0.0.0-11ae6e1
  displayName: NetObserv development catalog
  publisher: Me
  updateStrategy:
    registryPoll:
      interval: 1m

@codecov
Copy link

codecov bot commented Jan 24, 2025

Codecov Report

Attention: Patch coverage is 40.00000% with 18 lines in your changes missing coverage. Please review.

Project coverage is 62.52%. Comparing base (b2b9812) to head (9e19be1).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
pkg/cluster/cluster.go 30.76% 13 Missing and 5 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1052      +/-   ##
==========================================
+ Coverage   62.43%   62.52%   +0.09%     
==========================================
  Files          77       77              
  Lines       11581    11601      +20     
==========================================
+ Hits         7231     7254      +23     
+ Misses       3891     3890       -1     
+ Partials      459      457       -2     
Flag Coverage Δ
unittests 62.52% <40.00%> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
pkg/manager/manager.go 58.18% <ø> (ø)
pkg/test/envtest.go 98.12% <100.00%> (+0.04%) ⬆️
pkg/cluster/cluster.go 64.64% <30.76%> (-8.85%) ⬇️

... and 4 files with indirect coverage changes

@github-actions github-actions bot removed the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Jan 24, 2025
@msherif1234
Copy link
Contributor Author

/ok-to-test

@openshift-ci openshift-ci bot added the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Jan 24, 2025
@github-actions
Copy link

New images:

  • quay.io/netobserv/network-observability-operator:22671dd
  • quay.io/netobserv/network-observability-operator-bundle:v0.0.0-22671dd
  • quay.io/netobserv/network-observability-operator-catalog:v0.0.0-22671dd

They will expire after two weeks.

To deploy this build:

# Direct deployment, from operator repo
IMAGE=quay.io/netobserv/network-observability-operator:22671dd make deploy

# Or using operator-sdk
operator-sdk run bundle quay.io/netobserv/network-observability-operator-bundle:v0.0.0-22671dd

Or as a Catalog Source:

apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: netobserv-dev
  namespace: openshift-marketplace
spec:
  sourceType: grpc
  image: quay.io/netobserv/network-observability-operator-catalog:v0.0.0-22671dd
  displayName: NetObserv development catalog
  publisher: Me
  updateStrategy:
    registryPoll:
      interval: 1m

Signed-off-by: Mohamed Mahmoud <mmahmoud@redhat.com>
@github-actions github-actions bot removed the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Jan 24, 2025
@msherif1234
Copy link
Contributor Author

/ok-to-test

@openshift-ci openshift-ci bot added the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Jan 24, 2025
@github-actions
Copy link

New images:

  • quay.io/netobserv/network-observability-operator:03a47e2
  • quay.io/netobserv/network-observability-operator-bundle:v0.0.0-03a47e2
  • quay.io/netobserv/network-observability-operator-catalog:v0.0.0-03a47e2

They will expire after two weeks.

To deploy this build:

# Direct deployment, from operator repo
IMAGE=quay.io/netobserv/network-observability-operator:03a47e2 make deploy

# Or using operator-sdk
operator-sdk run bundle quay.io/netobserv/network-observability-operator-bundle:v0.0.0-03a47e2

Or as a Catalog Source:

apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: netobserv-dev
  namespace: openshift-marketplace
spec:
  sourceType: grpc
  image: quay.io/netobserv/network-observability-operator-catalog:v0.0.0-03a47e2
  displayName: NetObserv development catalog
  publisher: Me
  updateStrategy:
    registryPoll:
      interval: 1m

@openshift-ci
Copy link

openshift-ci bot commented Jan 24, 2025

@msherif1234: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-operator 228b019 link false /test e2e-operator

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@msherif1234 msherif1234 changed the title Fix Openshift version check to work on ROSA NETOBSERV-2078: Fix Openshift version check to work on ROSA Jan 27, 2025
@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Jan 27, 2025

@msherif1234: This pull request references NETOBSERV-2078 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.19.0" version, but no target version was set.

Details

In response to this:

Description

Fix OCP version check to work on ROSA

Dependencies

n/a

Checklist

If you are not familiar with our processes or don't know what to answer in the list below, let us know in a comment: the maintainers will take care of that.

  • Is this PR backed with a JIRA ticket? If so, make sure it is written as a title prefix (in general, PRs affecting the NetObserv/Network Observability product should be backed with a JIRA ticket - especially if they bring user facing changes).
  • Does this PR require product documentation?
  • If so, make sure the JIRA epic is labeled with "documentation" and provides a description relevant for doc writers, such as use cases or scenarios. Any required step to activate or configure the feature should be documented there, such as new CRD knobs.
  • Does this PR require a product release notes entry?
  • If so, fill in "Release Note Text" in the JIRA.
  • Is there anything else the QE team should know before testing? E.g: configuration changes, environment setup, etc.
  • If so, make sure it is described in the JIRA ticket.
  • QE requirements (check 1 from the list):
  • Standard QE validation, with pre-merge tests unless stated otherwise.
  • Regression tests only (e.g. refactoring with no user-facing change).
  • No QE (e.g. trivial change with high reviewer's confidence, or per agreement with the QE team).

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@jotak
Copy link
Member

jotak commented Jan 28, 2025

This works fine on my 4.18 cluster (non ROSA)
Also, confirmed cluster ID is still there when configured:
image

/lgtm

@msherif1234
Copy link
Contributor Author

it seems both ways works CNO might be bit faster to create vs CVO so this more of nit at this point no rush on making this change now so I will close this PR and we can reopen if needed in the future

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/valid-reference lgtm ok-to-test To set manually when a PR is safe to test. Triggers image build on PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants